package com.example.sys.solicitation.dao;

import com.example.core.dao.BaseTreeDao;
import com.example.sys.solicitation.po.SysSolicitationTemplate;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.io.Serializable;
import java.util.List;

@Mapper
public interface SysSolicitationTemplateDao extends BaseTreeDao<SysSolicitationTemplate> {

    @Select("select * from sys_solicitation_template where main_id =#{mainId} and parent_id is null order by order_num asc")
    public List<SysSolicitationTemplate> findByMainId(@Param("mainId") String mainId);

    @Select("select * from sys_solicitation_template where parent_id =#{pid} order by order_num asc")
    @Override
    List<SysSolicitationTemplate> findByPId(@Param("pid") Serializable pid);
}
